// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import store from './store';
import App from './App';
import router from './router';
import VConsole from 'vconsole/dist/vconsole.min.js' //import vconsole
import Swiper from 'vue-awesome-swiper';

import VueLazyload from 'vue-lazyload';

Vue.config.productionTip = false



//轮播图
Vue.use(Swiper);

//图片懒加载
Vue.use(VueLazyload, {
  preLoad: 1.3,
  error: 'http://img5.imgtn.bdimg.com/it/u=4289278818,3126321099&fm=200&gp=0.jpg',
  loading: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1531287929642&di=ba53b52c6542e0eba85ddb9bd4f41d3d&imgtype=0&src=http%3A%2F%2Fimg.zcool.cn%2Fcommunity%2F01d08c58d9decea801219c778f9648.gif',
  attempt: 1
})

//路由钩子 在进入路由之前 每一次都会执行此方法
router.beforeEach(function (to, from, next) {
  document.title = to.meta.title;
  next();
});
// init vConsole
let vConsole = new VConsole() // 初始化

import 'swiper/dist/css/swiper.css';

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
